<%@page import="com.libweb.model.dao.MemberDao"%>
<%@page import="com.libweb.model.dto.Member"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>

<%
	Member member = (Member)request.getAttribute("member");
	String memberId = request.getParameter("memberid");
%>
	
<!DOCTYPE html>


<html>
<head>
	<meta charset="utf-8" />
	<title>개인 정보 수정</title>
	<link rel="Stylesheet" href="/libweb/styles/default.css" />
	<link rel="Stylesheet" href="/libweb/styles/input2.css" />
	<script type="text/javascript">
		function doDelete(memberid,loginuser) {
			var ok = confirm("계정을 탈퇴합니다.");
			if (ok) {
				//삭제처리
				location.href="delete.action?memberid=" + memberid + "&loginuser=" + loginuser;
			}
		}
	</script>		
</head>
<body>
	<div id="pageContainer">
	
		<% pageContext.include("/WEB-INF/views/include/header.jsp"); %>
		<% Member memberu = (Member)session.getAttribute("loginuser"); %>	
		<div style="padding-top:25px;text-align:center">
			<div id="inputcontent">
			    <div id="inputmain">
			        <div class="inputsubtitle">개인 정보 수정</div>
			        <form action="update.action" method="post">
				        <table>
				            <tr>
				                <th>아이디</th>
				                <td>
				                	<%= member.getMemberId() %>
				                	<input type="hidden" name="memberid"
				                	value="<%= member.getMemberId() %>" />				                					                	
				                </td>
				            </tr>
				            <tr>
				                <th>이름</th>
				                <td>
				                	<input type="text" name="name" style="width:550px"
				                		value="<%= member.getName() %>" />
				                </td>
				            </tr>
				            <tr>
				                <th>전화번호</th>
				                <td>
				                	<input type="text" name="phoneno" style="width:550px"
				                		value="<%= member.getPhoneNo() %>" />
				                <td/>
				            </tr>
				            <tr>
				                <th>주소</th>
				                <td>				              
				                	<input type="text" name="address" style="width:550px"
				                		value="<%= member.getAddress() %>" />
				                <td/>
				            </tr>
				            <tr>
				                <th>등록일</th>
				                <td><%= member.getRegDate() %></td>
				            </tr>							
				        </table>
			        </form>
			        <div class="buttons">
			        	<!--  <input type="submit" value="수정" /> -->
			        	<a href="javascript:document.forms[0].submit();">수정</a>
			        	&nbsp;
			        	<a href="javascript:history.back();">취소</a>
			        	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			        	<a href="javascript:doDelete('<%=member.getMemberId()%>','<%=memberu.getMemberId()%>');">탈퇴</a>
			        </div>
			    </div>
			</div>   	
		
		</div>
	</div>

</body>
</html>